import Taro from '@tarojs/taro'
import "taro-ui/dist/style/components/button.scss" // 按需引入
import { View, Text, Image, Navigator } from '@tarojs/components'
import './launchServer.less'
import { AtIcon } from 'taro-ui'

function LaunchServer() {
    const state = {
        list: [
            {
                value: 1,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0qap12nj3025025q2w.jpg',
                name: '理发',
                require: '按照残疾人要求，为老人上门理发',
            },
            {
                value: 2,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0qaoi38j3025024mx4.jpg',
                name: '助医',
                require: '陪同老人到医院就诊',
            },
            {
                value: 3,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0qao24zj3027026dft.jpg',
                name: '洗涤',
                require: '对床单等洗涤晾晒',
            },
            {
                value: 4,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0qaed4sj3025025wef.jpg',
                name: '助浴',
                require: '帮助残疾人洗澡清洗',
            },
            {
                value: 5,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0qardmoj30260250sp.jpg',
                name: '个人护理',
                require: '帮助残疾人整理个人卫生',
            },
            {
                value: 6,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0xxkoexj3025025jrd.jpg',
                name: '精神慰藉',
                require: '余残疾人保持良性互动，调节心理状况',
            },
            {
                value: 7,
                headSrc: 'http://ww1.sinaimg.cn/large/006wWQZtgy1gtl0qapadhj30250253yh.jpg',
                name: '康复训练',
                require: '制定规范的家庭康复训练计划',
            },
        ]
    }
    const goDetail = (value) => {
        // console.log(value);
        let value1 = JSON.stringify(value);
        Taro.navigateTo({
            url:`/pages/index/launchServer/launchServerDetail/launchServerDetail?value=${value1}`
        })
    }
  
    return <View className="launchServerBox">
        {
            state.list.map((item, index) => {
                return (
                        <Navigator>
                            <View className="peopleBox">
                                <View className="pBlist1" onClick={() => goDetail(item)}>
                                    <View className="listLeftBox">
                                        <View className="pBImgBox">
                                            <Image src={item.headSrc}></Image>
                                        </View>
                                        <View className="pBConBox">
                                            <View>
                                                <Text>{item.name}</Text>
                                            </View>
                                            <Text>{item.require}</Text>
                                        </View>
                                    </View>
                                </View>
                            </View>
                        </Navigator>
                    // </View>
                )
            })
        }

    </View>
}

export default LaunchServer;